package com.earl.gsm.web.system;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.earl.gsm.commons.vo.ResultMessage;
import com.earl.gsm.domain.sercurity.user.User;
import com.earl.gsm.service.MatchDetailService;
import com.earl.gsm.web.BaseController;
import com.wordnik.swagger.annotations.ApiOperation;

@Controller
//@Api(value="Person Rest Service") //修改生成的son路径
public class PageController extends BaseController {

    private final Logger log = LoggerFactory.getLogger(PageController.class);

    @Autowired
    private MatchDetailService service;

    private ResultMessage result = null;

    /**
     * GET /users -> get all the users
     */
    @RequestMapping(value = "/index", method = RequestMethod.GET)
    @ApiOperation(value = "得到所有比赛简易信息", notes = "find All User", httpMethod = "GET", response = User.class, responseContainer = "List")
    public String getAll() {
        log.debug("REST request to get all Users");
        result = new ResultMessage();
        result.setServiceResult(true);
        result.getResultParm().put("matchDetail", service.findAll());
        return "index";
    }
}
